package org.example.quartz.mode;

import lombok.Getter;
import lombok.Setter;
import org.example.quartz.task.QuartzTaskJob;

import java.io.Serializable;
import java.util.Map;

/**
 * @version 1.0.0
 * @ClassName CronTimingModel.java
 * @Description cron触发器model
 */
@Getter
@Setter
public class CronTimingModel extends TimingModel implements Serializable {

    private static final long serialVersionUID = 1L;
    /**
     * cron表达式
     * */
    private String cronExpression;

    public CronTimingModel(Class<? extends QuartzTaskJob> taskClass, String taskName, String groupName, String description, Map<String, Object> param, String cronExpression) {
        super(taskClass, taskName, groupName, description, TriggerType.CRON, param);
        this.cronExpression = cronExpression;
    }

    public CronTimingModel(Class<? extends QuartzTaskJob> taskClass, String taskName, String groupName, String description, String cronExpression) {
        super(taskClass, taskName, groupName, description, TriggerType.CRON);
        this.cronExpression = cronExpression;
    }
}
